﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.Infrastructure;
using DLM.Domain.Model;

namespace DLM.Data.EF.CodeFirst.Mapping
{
   public class BonusMap:EntityTypeConfiguration<Bonus>
    {
       public BonusMap()
       {
           this.HasKey(t => t.BonusID);
           this.ToTable("Bonus");
           this.Property(t => t.BonusID).HasColumnName("BonusID");
           this.Property(t => t.UserID).HasColumnName("UserID");
           this.Property(t => t.Bonuses).HasColumnName("Bonus");
           this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
           this.Property(t => t.CreateDate).HasColumnName("CreateDate");
           this.HasRequired(t => t.User).WithMany(t => t.Bonus).HasForeignKey(d => d.UserID);
       }
    }
}
